-
Notifications
You must be signed in to change notification settings - Fork 32
Add a warning message about "--environment in SBATCH" #237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a warning message about "--environment in SBATCH" #237
Conversation
preview available: https://docs.tds.cscs.ch/237 |
... | ||
``` | ||
|
||
As the use of `--environment` as an `#SBATCH` option is reserved for highly customized workflows, users should have a high level of proficiency and a full understanding of the risk to encounter cryptic behaviors. Should users encounter a problem while using `--environment` as `#SBATCH`, it's recommended to move `--environment` from `#SBATCH` to each `srun` and see if the problem disappears. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also mention a benefit of only using --environment
as an argument to srun
: if you have more than one srun command in the batch script, you can easily use different containers for the different commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look at the added usage example below
Co-authored-by: Ben Cumming <[email protected]>
preview available: https://docs.tds.cscs.ch/237 |
1 similar comment
preview available: https://docs.tds.cscs.ch/237 |
For the benefit of the revision, let me briefly summarize the revision items suggested by people.
Thanks for all the comments, as always, but I need to figure out how to fit these suggestions into this PR because it's currently focused on the warning part; it can easily look awkward if we're talking about benefits and suggestions when the title is "why we discourage it." |
preview available: https://docs.tds.cscs.ch/237 |
preview available: https://docs.tds.cscs.ch/237 |
Multiple Slurm commands may have different EDF environments; this is useful when a single environment is not feasible due to compatibility issues or keep EDF files modular. | ||
|
||
!!! example "`srun`s with different EDFs" | ||
```bash | ||
#!/bin/bash | ||
#SBATCH --job-name=edf-example | ||
#SBATCH --time=00:01:00 | ||
... | ||
srun --environment=env1 ... # (1)! | ||
... | ||
srun --environment=env2 ... # (2)! | ||
``` | ||
|
||
1. Assuming `env1.toml` is at `EDF_PATH`. See [EDF search path][ref-ce-edf-search-path] below. | ||
2. Assuming `env2.toml` is at `EDF_PATH`. See [EDF search path][ref-ce-edf-search-path] below. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bcumming I added the benefit of using different EDFs here. I decided to put it outside the warning and introduce this as a usage example (in "Using container engine").
Resolves: VCUE-1014
As specifying "--environment" as an "#SBATCH" option has caused many nonsensical problems, the container team decided to add an explicit warning (alongside some mitigations to known errors). To avoid distraction, the warning message was kept short in the main usage page ("Using container engine") and linked to the main warning message ("Known issues").